<script setup>
import { onMounted } from 'vue'
import { storeToRefs } from 'pinia'
import { userBasicInfoStore } from '../../store/user'
const userBasicInfo = userBasicInfoStore()
const { basicInfo, environment } = storeToRefs(userBasicInfo)
// 组件被挂载后调用
onMounted(() => {
  userBasicInfo.fetchUserBasicInfo()
  userBasicInfo.fetchUserEnvironment()
})
console.log(environment)
</script>

<template>
  <v-card :subtitle="userBasicInfo.getEnvironment" :title="basicInfo?.gameName">
    <template #prepend>
      <v-avatar color="blue-darken-2">
        <v-icon icon="mdi-alarm"></v-icon>
      </v-avatar>
    </template>
    <template #append>
      <v-avatar size="24">
        <v-img alt="John" src="https://cdn.vuetifyjs.com/images/john.png"></v-img>
      </v-avatar>
    </template>
    <v-card-text
      >Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.</v-card-text
    >
  </v-card>
</template>
